package com.gkd.mapper;

import com.gkd.pojo.Department;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
@Component
@Transactional
@Repository
public interface DepartmentMapper {

    @Select("select * from mybatis.departments")
    List<Department> queryDepartmentAll();

    @Select("select * from mybatis.departments where id = #{id}")
    Department selectDepartmentById(int id);

    @Delete("delete from mybatis.departments where id = #{id}")
    void deleteDepartment(int id);
}
